# ========================== 参数 ==========================
# var:
# model:        当前处理的model分类
# file_path:    当前处理的脚本或程序文件路径
# file_content: 写入$model.source文件的内容数组
# help_content: 命令help文件内容数组,写入格式[command:file_path]
#
# function:
# _process:     (_process [message] [type]) 过程输出函数
# _cmd_handle:  文件扫描处理(生成alias别名,生成fpath文件,生成help文件内容,...)
#                   必要参数:
#                       term:           命令执行解析(/bin/bash /bin/zsh ...)
# ========================== 说明 ==========================
# 处理fpath补全脚本文件
# ========================== end ==========================

local -A global_fpath
_write=1
_file_name=${file_path:t}
_file_path=$home/fpath/$_file_name
_process "生成补全文件 >>> $_file_path"
sed "s#\$CAL_HOME#$CAL_HOME#g" $file_path > $_file_path

for _path (${=${"$(<${_file_path})"[(f)1]#* }}) {
    global_fpath[$_path]=$_file_path
}
unset _file_name _file_path